import { HTTP } from '../util/http.js'

export class LikeModel extends HTTP {
    like(behavior, artId, type) {
        let url = behavior == 'like' ? '/like' : '/like/cancel'
        this.request({
            url: url,
            method: 'POST',
            data: {
                art_id: artId,
                type: type
            }
        })
    }
    _getLikeStatus(artId, type, sCallback) {
        this.request({
            url: '/classic/' + type + '/' + artId + '/favor',
            success: ((res) => { 
                sCallback(res)
            })
        })
    }
}